package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"ruoyi-vue-pro-go/api/common"
	"ruoyi-vue-pro-go/internal/model/entity"
	"ruoyi-vue-pro-go/internal/model/vo"
)

type GetDataSourceConfigReq struct {
	g.Meta `path:"/admin-api/infra/data-source-config/get" method:"get" tags:"infra" permission:"infra:codegen:query" summary:"Get data source config list"`
	Id     int64 `v:"required" dc:"data source config id"`
}
type GetDataSourceConfigRes struct {
	*entity.InfraDataSourceConfig `json:"dataSourceConfig" dc:"data source config"`
}

type GetDataSourceConfigListReq struct {
	g.Meta `path:"/admin-api/infra/data-source-config/list" method:"get" tags:"infra" permission:"infra:codegen:query" summary:"Get data source config list"`
}
type GetDataSourceConfigListRes struct {
	List []*entity.InfraDataSourceConfig `json:"list" dc:"data source config list"`
}

type GetDataSourceTableListReq struct {
	g.Meta             `path:"/admin-api/infra/codegen/db/table/list" method:"get" tags:"infra" permission:"infra:codegen:query" summary:"Get data source table list"`
	DataSourceConfigId int64  `json:"dataSourceConfigId" dc:"data source config id"`
	Name               string `json:"name" dc:"data source table name"`
	Comment            string `json:"comment" dc:"data source table comment"`
}
type GetDataSourceTableListRes struct {
	List []*vo.DataSourceTableVO `json:"list" dc:"data source table list"`
}

type CreateDataSourceConfigReq struct {
	g.Meta   `path:"/admin-api/infra/data-source-config/create" method:"post" tags:"infra" permission:"infra:codegen:create" summary:"Create data source config"`
	Name     string `v:"required#名称不能为空|unique:true" dc:"数据源名称"`
	Url      string `v:"required#数据源连接地址不能为空" dc:"数据源地址"`
	Username string `v:"required#用户名不能为空" dc:"数据源账号"`
	Password string `v:"required#密码不能为空" dc:"数据源密码"`
	Creator  string `json:"creator" dc:"创建人"`
	Updater  string `json:"updater" dc:"更新人"`
}
type CreateDataSourceConfigRes struct{}

type GetCodegenTablePageReq struct {
	g.Meta `path:"/admin-api/infra/codegen/table/page" method:"get" tags:"codegen table Page" summary:"Get codegen table pages"`
	*common.CommonPageReq
	TableName    string   `json:"tableName" dc:"table name"`
	TableComment string   `json:"tableComment" dc:"table comment"`
	CreateTime   []string `json:"createTime" dc:"create time"`
}
type GetCodegenTablePageRes struct {
	List []*entity.InfraCodegenTable `json:"list" dc:"codegen table pages"`
	*common.CommonPageRes
}
